home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Concept 6
/
CD Concept 06.iso
/
mac
/
UTILITAIRE
/
RLaB
/
testmatrix
/
prolate.r
< prev
next >
Wrap
Text File
|
1994-12-20
|
1KB
|
44 lines
//-------------------------------------------------------------------//
// Synopsis: Prolate matrix - symmetric, ill-conditioned
// Toeplitz matrix.
// Syntax: A = prolate ( N , W )
// Description:
// A is the N-by-N prolate matrix with parameter W.
// It is a symmetric Toeplitz matrix.
// If 0 < W < 0.5 then
// - A is positive definite
// - the eigenvalues of A are distinct, lie in (0, 1), and
// tend to cluster around 0 and 1.
// W defaults to 0.25.
// Reference:
// J.M. Varah. The Prolate matrix. Linear Algebra and Appl.,
// 187:269--278, 1993.
// This file is a translation of prolate.m from version 2.0 of
// "The Test Matrix Toolbox for Matlab", described in Numerical
// Analysis Report No. 237, December 1993, by N. J. Higham.
// Dependencies
require toeplitz
//-------------------------------------------------------------------//
prolate = function ( n , w )
{
local (n, w)
global (pi)
if (!exist (w)) { w = 0.25; }
a = zeros (n, 1);
a[1] = 2*w;
a[2:n] = sin( 2*pi*w*(1:n-1) ) ./ ( pi*(1:n-1) );
return toeplitz(a);
};